class Array

  # execute block for each element of array, passing the element as the block
  # parameter until the block returns true
  def each_until(&block)
    return false if empty?
    for i in 0..size-1
      return true if block.call(self[i]) 
    end
    false
  end

  # return a subarray consisting of elements 2..n of the array 
  # (i.e. all except the first element)
  def tail
    return self[1,size-1] if size>1
    return []
  end
end
